<%@ page import="com.zbec.framework.security.service.SecurityService" %>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="com.zbec.framework.security.entity.SysMenu" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%--<cache:cache scope="session">--%>
<%
    List<SysMenu> menus =
            WebApplicationContextUtils.getWebApplicationContext(application).getBean(SecurityService.class).fetchMenu();
    request.setAttribute("menus", menus);
%>

<div class="menu_container">
    <ul class="menu">
        <li class="current"><a href="javascript:void(0)" onclick="menuLink('${ctx}/home/portalets')" class="menu_1st"><span>首页&nbsp; </span></a></li>
        <c:forEach items="${menus}" var="menu">
            <li class="">
                <div class="sublist">
                    <ul >
                        <c:forEach items="${menu.childrenMenus}" var="childMenu">
                            <li><a href="javascript:void(0)" onclick="menuLink('${ctx}${childMenu.menuUrl}',this)"><span>${childMenu.menuName}</span></a></li>
                        </c:forEach>
                    </ul>
                </div>
                <a href="#" class="menu_1st"><span>${menu.menuName}</span></a>

            </li>
        </c:forEach>
        <li class="back" style="left: 112px; width: 107px; display: block; overflow: hidden;">
            <div class="left"></div>
        </li>
    </ul>
</div>
<div class="clr"></div>
<%--</cache:cache>--%>